﻿using System;
using System.Collections.Generic;

namespace XUCore.WeChat.Enterprise
{
    public class EnterpriseWeChatFuncs
    {
        /// <summary>
        /// 获取企业微信号配置
        /// </summary>
        public Func<List<EnterpriseWeChatOption>> GetEnterpriseWeChatOptions { get; set; }

        /// <summary>
        /// 获取企业号的应用配置
        /// </summary>
        /// <returns></returns>
        public Func<string, string, int, (string suiteId, string suiteSecret, EnterpriseWeChatAgent agent)> GetEnterpriseWeChatAgentOptions { get; set; }

        /// <summary>
        /// 根据AppId获取Ticket
        /// </summary>
        public Func<string, string> GetEnterpriseWeChatTicketByAppId { get; set; }

        /// <summary>
        /// 根据corpId获取企业微信的Access Token
        /// </summary>
        public Func<string, string> GetEnterpriseWeChatAccessTokenByCorpId { get; set; }

        /// <summary>
        /// 缓存企业微信Access Token
        /// </summary>
        public Action<string, string> CacheEnterpriseWeChatAccessToken { get; set; }

        /// <summary>
        /// 缓存Ticket
        /// </summary>
        public Action<string, string> CacheEnterpriseWeChatTicket { get; set; }

        /// <summary>
        /// 根据suiteId获取企业微信的Ticket
        /// </summary>
        public Func<string, string> GetEnterpriseWeChatSuiteTicket { get; set; }

        /// <summary>
        /// 缓存Suite Ticket 临时ticket只有30分钟的时效，但是官方会大概10分钟推送一次
        /// </summary>
        public Action<string, string> CacheEnterpriseWeChatSuiteTicket { get; set; }
    }
}
